package com.dianping.cat.home.dependency.config.entity;

import com.dianping.cat.home.dependency.config.BaseEntity;
import com.dianping.cat.home.dependency.config.IVisitor;
import java.util.LinkedHashMap;
import java.util.Map;








public class NodeConfig
  extends BaseEntity<NodeConfig>
{
  private String m_type;
  private Integer m_defaultWarningThreshold;
  private Integer m_defaultErrorThreshold;
  private Double m_defaultWarningResponseTime;
  private Double m_defaultErrorResponseTime;
/*  23 */   private Map<String, DomainConfig> m_domainConfigs = new LinkedHashMap();

  private int m_defaultMinCountThreshold = 100;





  public NodeConfig(String type) { this.m_type = type; }




  public void accept(IVisitor visitor) { visitor.visitNodeConfig(this); }

  
  public NodeConfig addDomainConfig(DomainConfig domainConfig) {
/*  40 */     this.m_domainConfigs.put(domainConfig.getId(), domainConfig);
/*  41 */     return this;
  }

  
  public boolean equals(Object obj) {
/*  46 */     if (obj instanceof NodeConfig) {
/*  47 */       NodeConfig _o = (NodeConfig)obj;

/*  49 */       if (!equals(getType(), _o.getType())) {
/*  50 */         return false;
      }
      
/*  53 */       return true;
    }
    
/*  56 */     return false;
  }

  
/*  60 */   public DomainConfig findDomainConfig(String id) { return (DomainConfig)this.m_domainConfigs.get(id); }

  
  public DomainConfig findOrCreateDomainConfig(String id) {
/*  64 */     DomainConfig domainConfig = (DomainConfig)this.m_domainConfigs.get(id);

/*  66 */     if (domainConfig == null) {
/*  67 */       synchronized (this.m_domainConfigs) {
/*  68 */         domainConfig = (DomainConfig)this.m_domainConfigs.get(id);

/*  70 */         if (domainConfig == null) {
/*  71 */           domainConfig = new DomainConfig(id);
/*  72 */           this.m_domainConfigs.put(id, domainConfig);
        }
      }
    }
    
/*  77 */     return domainConfig;
  }

  
/*  81 */   public Double getDefaultErrorResponseTime() { return this.m_defaultErrorResponseTime; }



/*  85 */   public Integer getDefaultErrorThreshold() { return this.m_defaultErrorThreshold; }



/*  89 */   public int getDefaultMinCountThreshold() { return this.m_defaultMinCountThreshold; }



/*  93 */   public Double getDefaultWarningResponseTime() { return this.m_defaultWarningResponseTime; }



/*  97 */   public Integer getDefaultWarningThreshold() { return this.m_defaultWarningThreshold; }



/* 101 */   public Map<String, DomainConfig> getDomainConfigs() { return this.m_domainConfigs; }



/* 105 */   public String getType() { return this.m_type; }


  
  public int hashCode() {
/* 110 */     int hash = 0;

/* 112 */     return hash * 31 + ((this.m_type == null) ? 0 : this.m_type.hashCode());
  }



  
  public void mergeAttributes(NodeConfig other) {
/* 119 */     assertAttributeEquals(other, "node-config", "type", this.m_type, other.getType());

/* 121 */     if (other.getDefaultWarningThreshold() != null) {
/* 122 */       this.m_defaultWarningThreshold = other.getDefaultWarningThreshold();
    }
    
/* 125 */     if (other.getDefaultErrorThreshold() != null) {
/* 126 */       this.m_defaultErrorThreshold = other.getDefaultErrorThreshold();
    }
    
/* 129 */     if (other.getDefaultWarningResponseTime() != null) {
/* 130 */       this.m_defaultWarningResponseTime = other.getDefaultWarningResponseTime();
    }
    
/* 133 */     if (other.getDefaultErrorResponseTime() != null) {
/* 134 */       this.m_defaultErrorResponseTime = other.getDefaultErrorResponseTime();
    }
    
/* 137 */     this.m_defaultMinCountThreshold = other.getDefaultMinCountThreshold();
  }

  
/* 141 */   public DomainConfig removeDomainConfig(String id) { return (DomainConfig)this.m_domainConfigs.remove(id); }

  
  public NodeConfig setDefaultErrorResponseTime(Double defaultErrorResponseTime) {
/* 145 */     this.m_defaultErrorResponseTime = defaultErrorResponseTime;
/* 146 */     return this;
  }
  
  public NodeConfig setDefaultErrorThreshold(Integer defaultErrorThreshold) {
/* 150 */     this.m_defaultErrorThreshold = defaultErrorThreshold;
/* 151 */     return this;
  }
  
  public NodeConfig setDefaultMinCountThreshold(int defaultMinCountThreshold) {
/* 155 */     this.m_defaultMinCountThreshold = defaultMinCountThreshold;
/* 156 */     return this;
  }
  
  public NodeConfig setDefaultWarningResponseTime(Double defaultWarningResponseTime) {
/* 160 */     this.m_defaultWarningResponseTime = defaultWarningResponseTime;
/* 161 */     return this;
  }
  
  public NodeConfig setDefaultWarningThreshold(Integer defaultWarningThreshold) {
/* 165 */     this.m_defaultWarningThreshold = defaultWarningThreshold;
/* 166 */     return this;
  }
  
  public NodeConfig setType(String type) {
/* 170 */     this.m_type = type;
/* 171 */     return this;
  }
  
  public NodeConfig() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/classes/!/com/dianping/cat/home/dependency/config/entity/NodeConfig.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */